The present invention generally relates to bar code reading apparatuses, and more particularly to a bar code reading apparatus which reads a bar code by using light reflected from the bar code.
Recently, management systems for goods using bar codes are popularly employed. For this reason, the bar code is not necessarily printed on paper and the bar code is in many cases printed on the product itself. When the bar code is printed on the product itself, the reflectivity of the background part of the bar code depends on each product. Hence, the signal-to-noise (S/N) ratio of the bar code part and the background part becomes poor depending on the reflectivity of the background part. The bar code cannot be read correctly if the S/N ratio of the bar code part and the background part is poor, and there is a demand to accurately read the bar code regardless of the reflectivity of the background part.
The reflectivity of the background part differs depending on the product for the following reasons. First, the state of the background part such as the material, color and surface roughness is different for each product. Hence, even though a white coating usually covers the background part of the product where the bar code is printed, the reflectivity of the background part is still different for each product. Second, when dirt or the like adheres on the background part or the background part is scratched while the product is transported, the dirt or scratch appears as noise when the bar code is detected. As a result, the reflectivity of the background part may be different among the products of the same kind and may vary within the same bar code. Third, the printing of the bar code cannot be controlled perfectly so that the printed bar codes on the products of the same kind are identical. In other words, some printed bar codes may inevitably be darker than others or vice versa. Therefore, the reflectivity of the background part may be different even among the products of the same kind.
Generally, the bar code reading apparatus includes a light source for illuminating the bar code, a light receiving part for receiving reflected light from the bar code, a shaping circuit for shaping an electrical signal which is obtained by a photoelectric conversion in the light receiving part, and a decoding circuit for decoding the bar code from a shaped signal which is output from the shaping circuit.
Various methods of decoding the bar code in the decoding circuit have been proposed. For example, a first method slices an average value as shown in FIG. 1, and a second method detects middle points as shown in FIG. 2.
According to the first method shown in FIG. 1, an average of all waveforms of a signal I which has been smoothened in the shaping circuit in order to eliminate noise is obtained so as to determine a reference voltage. The waveforms of the signal I correspond to the bars of the bar code. The signal I is then sliced by this reference voltage, and the bar code is read by detecting widths a through i of the bar code at the sliced part.
As a modification of this first method, there is a method which uses a plurality of reference voltages. In this case, each waveform is sliced at the plurality of reference voltages to detect widths for the same waveform, and an average of the detected widths is regarded as the detected width for this waveform. However, this modification of the first method requires a relatively long processing time because of the use of the plurality of reference voltages.
On the other hand, according to the second method shown in FIG. 2 obtains a middle point between adjacent peaks and valleys of the waveform of a smoothened signal II which is output from the shaping circuit. This middle point is used as a reference value, and a point indicated by a white circular mark in FIG. 2 where the waveform crosses the reference value is found. The bar code is read by detecting widths a through k between each two adjacent points indicated by the white circle. A maximum inclination of the waveform may be taken into consideration.
However, according to the first method described above, the reference voltage is constant. For this reason, when the reflectivity of the background part of the bar code greatly varies as shown in FIG. 3(A), the detection signal (waveform data) III corresponding to the detected bar code becomes as shown in FIG. 3(B). As shown in FIG. 3(B), the peaks of the detection signal III greatly differ and the valleys of the detection signal III also greatly differ. In addition, a noise N may be included in the detection signal III. As a result, even if the constant reference voltage is set to one of the voltages V1, V2 and V3 shown in FIG. 3(B), it is impossible to read the bar code accurately.
In the case of the second method shown in FIG. 2, the peaks and valleys of the noise part of the waveform are also detected because the smoothened signal output from the shaping circuit still includes noise which cannot be eliminated by the smoothing. As a result, the noise part causes inaccurate reading of the bar code. For example, the bar code pattern may include a defective part 2 shown in FIG. 4(A) where the reflectivity is different from other parts of the bar code. This defective part 2 may be caused by dirt on the bar code pattern or a printing error when the bar code pattern is printed. In this case, the peak and valley are also found in a bar code detection signal (waveform data) 3 at a part 3 shown in FIG. 4(B), and it is impossible to read the bar code accurately.